home *** CD-ROM | disk | FTP | other *** search
- class classes.misc.RapidFire
- {
- var cMax;
- var big;
- var c = 0;
- var c2 = 0;
- var c2Max = 20;
- var Name = "rapidFire";
- function RapidFire(max, pbig)
- {
- this.cMax = max;
- this.big = pbig;
- if(!this.big)
- {
- _root.rapidVar = 2;
- }
- else
- {
- _root.rapidVar = 3;
- }
- }
- function main()
- {
- this.c = this.c + 1;
- if(!this.big)
- {
- _root[_root.char].fireFreq = 3 + Math.round(this.c / (this.cMax / 6));
- }
- else
- {
- _root[_root.char].fireFreq = 4 + Math.round(this.c / (this.cMax / 6));
- }
- if(this.c == this.cMax)
- {
- _root[_root.char].fireFreq = _root[_root.char].fireFreqOrig;
- if(!this.big)
- {
- _root.rapidVar = 3;
- }
- else
- {
- _root.rapidVar = 4;
- }
- _root.currentBoost = "";
- _root.removePowerUp("rapidFire");
- }
- if(this.c < this.cMax / 3 && _root[_root.char].fire)
- {
- this.c2 = this.c2 + 1;
- this.c2Max /= 1.04;
- if(this.c2 >= Math.ceil(this.c2Max) + 1)
- {
- _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
- _root.addFX("gunSmoke" + this.c);
- this.c2 = 0;
- }
- }
- else if(this.c > this.cMax / 3 && _root[_root.char].fire)
- {
- this.c2 = this.c2 + 1;
- this.c2Max *= 1.03;
- if(this.c2 >= Math.ceil(this.c2Max) + 1)
- {
- _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
- _root.addFX("gunSmoke" + this.c);
- this.c2 = 0;
- }
- }
- }
- }
-